#!/bin/sh

set -e;
if [ -f "/home/admin/application/deploy.sh" ]; then /home/admin/application/deploy.sh stop; fi;
mkdir -p /home/admin/application;
tar xf /home/admin/package.tgz -o -C /home/admin/application;
chmod +x  /home/admin/application/deploy.sh;
/home/admin/application/deploy.sh start
